1. Field of the Invention
This invention relates to an in-focus detecting device for an image sensing apparatus.
2. Description of the Related Art
The conventional in-focus detecting methods for detecting the state of focus of a photo-taking lens, i.e., for detecting whether the lens is in focus, include two types. One is a passive type wherein the degree of in-focus is determined on the basis of correlation between two images formed by a twin-lens optical system. The other is an active type wherein the degree of in-focus is determined on the basis of the position of the spot of a reflected light flux obtained by illuminating a photographed object with infrared rays. Further, a method of detecting the state of focus through a video signal processing operation has been proposed as a result of recent popularization of electronic image sensing apparatuses such as video cameras, electronic still cameras, etc..
The focus detection through a video signal processing operation is based on the fact that the edge part of an image moderately varies to have a large width in the event of defocus while the width reaches a minimum value in an in-focus state. An example of this method has been disclosed in U.S. Pat. No. 4,804,831. In the case of a defocus state, signal intensity for the edge part of the image is as shown in FIG. 1(a) of the accompanying drawings. In the case of an in-focus state, the signal intensity distribution becomes as shown in FIG. 1(b). The edge width X1 obtained in the defocus state in relation to the degree d1 of change of signal intensity is computed as follows: ##EQU1##
In the above formula, "Il(X)" is a function indicating the intensity distribution of the edge part obtained when the lens is in the defocus state; and "dI1(X)/dX" represents the inclination of the edge part. A mean value of inclination values obtained from several points between a change starting point where the signal intensity starts changing or rising and a change ending point where the signal intensity ceases to rise is used as the value of above-stated inclination.
In the in-focus state, the edge width X2 which is shown in FIG. 1(b) is likewise computed as follows: ##EQU2##
In this formula, "d2" represents a difference in signal intensity between two sides of the edge part, i.e., a difference in luminance; "I2(X)" is a function indicating the intensity distribution obtained in the in-focus state; and "dI2(X)/dX" represents the inclination of the edge part. There is not much difference between "d1" and "d2". The inclination is steep in the in-focus state, that is, the width of the edge part decreases accordingly as the degree of in-focus increases. This permits in-focus detection.
In accordance with the above-stated example of the conventional method, however, it is impossible to accurately detect an in-focus state if the object has a low degree of contrast, because: In that case, the edge width of the image becomes large as a whole and the edge width obtained in the defocus state does not much differ from the edge width obtained in the in-focus state. For example, in cases where an algorithm of selecting, for in-focus detection, such an edge part that has the smallest edge width among images within a focus detecting area and is rapidly changing is used, the in-focus determination might be made on the basis of a wrong edge part during a focusing process. This would hinder an in-focus detecting action on an intended object and makes the operation of the in-focus detecting system unstable.